/*
 *  msnobj.h - Msn Object Functions
 *  Copyright (c) 2005 Derek Ingrouville (dergro@users.sourceforge.net)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _MSNOBJ_H
#define _MSNOBJ_H

#include "command.h"

typedef enum _MsnObjType
{
	MSN_OBJ_UNKNOWN = 0,
	MSN_OBJ_AVATAR = 1,
	MSN_OBJ_CUSTOM_EMOTICON = 2,
	MSN_OBJ_DISPLAY_PIC = 3,
	MSN_OBJ_SHARED_FILE = 4,
	MSN_OBJ_BACKGROUND = 5,
	MSN_OBJ_HISTORY = 6,
	MSN_OBJ_DELUXE_DISP_PIC = 7,
	MSN_OBJ_WINK = 8,
	MSN_OBJ_MAP_FILE = 9,
	MSN_OBJ_DYNAMIC_BACKGROUND = 10,
	MSN_OBJ_VOICE_CLIP = 11,
	MSN_OBJ_PLUGIN_STATE = 12,
	MSN_OBJ_ROAMING_OBJS = 13,
	MSN_OBJ_SIGNATURE_SOUND = 14
} MsnObjType;

typedef struct _MsnObject
{
	char *creator;	  /* Object Creator */
	long size;	      /* Length of file in bytes */
	MsnObjType type;  /* Type of file */
	char *location;	  /* Location of file */
	char *friendly;	  /* Base64 encoded UTF-16 string */
	char *sha1d;	  /* Base64 Encoded SHA1 hash of data */
	char *sha1c;	  /* Base64 Encoded SHA1 checksum */
	char *objstr;	  /* Full Object */
} MsnObject;

MsnObject *msn_object_new ();
MsnObject *msn_object_new_from_string (const char *str);
void msn_object_free (MsnObject *obj);

char *msn_object_to_string (MsnObject *obj);
void msn_object_set_creator (MsnObject *obj, char *creator);
void msn_object_set_location (MsnObject *obj, char *location);
void msn_object_set_friendly (MsnObject *obj, char *friendly);
void msn_object_set_sha1d (MsnObject *obj, char *sha1d);
void msn_object_set_sha1c (MsnObject *obj, char *sha1c);

#endif /* _MSNOBJ_H */

